<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    //
    protected $table='article';
    protected $timestamp=false;
    public function author(){
        // return $this->hasOne('App\Author','id','author_id');
        return $this->belongsTo('App\Author','author_id','id');
    }

    public function keyword(){
        return $this->belongsToMany('App\Keyword','article_keyword','article_id','keyword_id');
    }

}
